package com.rc.saas.tenant.service.ugs;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.rc.saas.tenant.mapper.ugs.UgsMemberPointRecordMapper;
import com.rc.saas.tenant.search.member.MemberPointRecordSearch;
import com.rc.saas.tenant.vo.member.MemberPointRecordResultVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class UgsMemberPointRecordServiceImpl implements UgsMemberPointRecordService {
    @Autowired
    private UgsMemberPointRecordMapper ugsMemberPointRecordMapper;

    @Override
    public UgsMemberPointRecordMapper getMapper() {
        return ugsMemberPointRecordMapper;
    }

    @Override
    public PageInfo<MemberPointRecordResultVo> searchByCondition(MemberPointRecordSearch memberPointRecordSearch) {
        PageHelper.startPage(memberPointRecordSearch.getOffset(), memberPointRecordSearch.getLimit());
        List<MemberPointRecordResultVo> memberAccountRecordResultVos = ugsMemberPointRecordMapper.searchByCondition(memberPointRecordSearch);
        return new PageInfo<MemberPointRecordResultVo>(memberAccountRecordResultVos);
    }
}
